/*
 * Copyright 2004-2005 aosft
 * 本软件及其所有拷贝的名称，与光盘上或本软件中注明的公司同在。
 * 本软件及文档享有版权，并受国家版权法及国际协约条款的保护。
 * 您不可以从本软件中去掉其版权声明；并保证为本软件的拷贝（本部或部分）* 复制版权声明。
 * 您同意制止以任何形式非法拷贝本软件及文档。
 * 版权信息参见：
 *      http://www.asoft.cn/licenses
 */

package com.asoft.examonline.teach.manager;

import java.util.List;

import org.apache.log4j.Logger;

import com.asoft.common.base.dao.DAO;
import com.asoft.common.base.manager.BaseManager;
import com.asoft.examonline.teach.dao.TeachResourceDAO;

/**
 * <p>Title: 教学资源</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: aosft</p>
 * @ $Author: author $
 * @ $Date: 2005/03/14 11:32:01 $
 * @ $Revision: 1.5 $
 * @ created in 2007-5-15
 *
 */

public class TeachResourceManagerimp extends BaseManager
                                 implements TeachResourceManager

{
        static Logger logger = Logger.getLogger(TeachResourceManagerimp.class);

        /** 教学资源DAO */
        private TeachResourceDAO teachResourceDAO;

        public void setTeachResourceDAO(TeachResourceDAO teachResourceDAO)
        {
                // 设置BaseManager.dao
                super.setDAO(teachResourceDAO);
                this.teachResourceDAO = teachResourceDAO;
        }
        
        /**
         * 单元测试用 
         */
        @Override
        public void setDAO(DAO dao)
        {
                this.setTeachResourceDAO((TeachResourceDAO)dao); 
        }

        /**
         * 描述:查询教学资源s
         *
         * @ param:
         * @ param:orderBy 排序属性（for hql）
         * @ param:sortType 排序方式（asc or desc）
         * @ Exception:
         * @ return model集合
         */
        public List findTeachResources(String domainId,
                                       String subjectId,
                                       String courseId,
                                       String unitId,
                                       String sectionId,
                                       String knowledgePointId,
                                       String knowledgeTypeId,
                                       String difficultyId,
                                       String publishCompanyId,
                                       String keyWord,
                                       String orderBy,
                                       String sortType)
        {
                return this.teachResourceDAO
                        .findTeachResources(domainId,
                                            subjectId,
                                            courseId,
                                            unitId,
                                            sectionId,
                                            knowledgePointId,
                                            knowledgeTypeId,
                                            difficultyId,
                                            publishCompanyId,
                                            keyWord,
                                            orderBy,
                                            sortType);
        }

        /**
         * 描述:查询教学资源s
         *
         * @ param:
         * @ param:orderBy 排序属性（for hql）
         * @ param:sortType 排序方式（asc or desc）
         * @ Exception:
         * @ return model集合
         */
        public List findTeachResources(String domainId,
                                       String subjectId,
                                       String courseId,
                                       String unitId,
                                       String sectionId,
                                       String knowledgePointId,
                                       String knowledgeTypeId,
                                       String difficultyId,
                                       String publishCompanyId,
                                       String keyWord)
    {
            return this.teachResourceDAO
                        .findTeachResources(domainId,
                                            subjectId,
                                            courseId,
                                            unitId,
                                            sectionId,
                                            knowledgePointId,
                                            knowledgeTypeId,
                                            difficultyId,
                                            publishCompanyId,
                                            keyWord,
                                            "tr.pri",
                                            "asc");
    }

        public List findTeachResourcesByKnowLedgePoint(String knowledgePointId)
        {
                return this.teachResourceDAO.findTeachResourcesByKnowLedgePoint(knowledgePointId);
        }
}
